<html><head><style type="text/css">@charset "UTF-8";[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}</style>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="description" content="">
    <meta name="viewport" content="user-scalable=no">

    <meta name="google-site-verification" content="BstJA3X9z6f9HcvoN9AZTwaKo_9Abj_j7dVBPfy640s">
    <meta name="baidu-site-verification" content="IYCrtVH0i1">
    <meta property="wb:webmaster" content="239d3d1dbdde1b2c">
    <link rel="icon" type="image/png" href="images/favicon.ico">

    <script type="text/javascript">

        (function(document, screen) {if (screen.width < 760) {document.location.href="/mobile/";}}(document, screen));
    </script>

    <link rel="stylesheet" href="/static/css/common.css?v=2015-5-20">

    <link rel="stylesheet" href="/static/css/user_center.css">

    <!--[if lte IE 7]><script>window.onload=function(){location.href="/ie6warning/"}</script><![endif]-->
    <!--[if lt IE 9]>
    <script src="js/respond.js"></script>
    <script>
        var e = "abbr, article, aside, audio, canvas, datalist, details, dialog, eventsource, figure, footer, header, hgroup, mark, menu, meter, nav, output, progress, section, time, video, dh-dialog, dh-checkbox".split(', ');
         var i= e.length;while (i--){document.createElement(e[i])}
    </script>
    <![endif]-->
    <title>个人中心 - 地址管理</title>
</head>
<body class="day  ng-scope" ng-controller="bodyCtrl" day-or-night="">
    <section class="common-back" id="wrapBackground">

            <header id="header">
                <div class="common-width clearfix">
                    <h1 class="fl">
                        <a class="logo base-logo" href="index.html">外卖超人</a>
                    </h1>

                        <ul class="member logging" ng-init="loginInfo=true">
                            <li><a href="{{ url('index:index') }}" class="index">首页</a></li>
                            <li class="userName">
                                <a href="member_index.html" rel="nofollow" draw-user="">{{ username }}<em></em></a>
                                <div>
                                    <p><a href="member_index.html" rel="nofollow">账号管理</a></p>
                                    <p><a href="member_addr.html" rel="nofollow">地址管理</a></p>
                                    <p class="no-bo"><a id="logout" href="#" referer-url="" rel="nofollow">退出</a></p>
                                </div>
                            </li>
{#                            <li class=""><a href="member_order.html" class="order-center" rel="nofollow">我的订单</a></li>#}
                            <li class=""><a href="{{ url('shoppingcarts:carts') }}" rel="nofollow">我的购物车</a></li>
                            <!-- <li class=""><a href="gifts.html" rel="nofollow">氪星礼品站</a></li> -->
{#                            <li class="phone-client "><a href="#" rel="nofollow" target="_blank"><span>手机客户端</span></a></li>#}
                        </ul>

                </div>
            </header>

        <div id="main-box">
             <!--二维码-->
            <div class="qrCode-frame" ng-hide="qrCodeStatus">
                <!-- <img src="images/wx.png" alt="扫描二维码"> -->
                <!-- <em ng-click="qrCodeStatus=true">X</em> -->
            </div>

            <div ng-controller="colorAction" class="ng-scope">
                <div class="dayColor_two"></div>
                <div class="dayColor_one"></div>
                <div class="dayColor_three" ng-class="{dayColor_threeActive:threeActive}"></div>
            </div>


    <section>
        <div class="user-center-main-box common-width clearfix">
            <aside class="fl">
                <ul>
                    <li>
                        <a href="{{ url('users:usercenter') }}" rel="nofollow">账号管理</a>
                    </li>
                    <li>
                        <a href="{{ url('users:my_order',args=(1,)) }}" rel="nofollow">我的订单</a>
                    </li>
                        <a href="{{ url('users:changepassword') }}" rel="nofollow">修改密码</a>
                    </li>
                    <li class="active">
                        <a href="{{ url('address:address') }}" rel="nofollow">地址管理</a>
                    </li>
                    <!-- <li> -->
                        <!-- <a href="gifts.html" rel="nofollow">氪星礼品站</a> -->
                    <!-- </li> -->
                </ul>
            </aside>
            <article class="fl user-center-main">
                <header>地址管理</header>

    <section class="user-address-main">
        <header>
            <h2>已保存地址</h2>
        </header>
        <article class="mb10">
            <table>
                <colgroup>
                    <col width="100px">
                    <col width="145px">
                    <col width="407px">
                    <col width="85px">
                </colgroup>
                <thead>
                    <tr>
                        <th>收单人</th>
                        <th>手机号码</th>
                        <th>送餐地址</th>
                        <th>操作</th>
                    </tr>
                    {% for address in addresses %}
                        <tr>
                            <th id="{{ address.id }}">{{ address.receiver }}</th>
                            <th>{{ address.phone }}</th>
                            <th>{{ address.place }}</th>
                            <th>
                            <button class="btn2" type="button" id="del">删除</button>
                            </th>
                        </tr>
                    {% endfor %}
                </thead>
                <tbody><!-- ngRepeat: item in userAddressList -->
            </tbody></table>
        </article>
        <article ng-show="userAddressList.length < 8">
            <header class="mb10">
                <h2>新增地址</h2><strong>(最多只能保存 8 个有效地址)</strong>
            </header>
            <section class="add-address-box">
                <form novalidate="true" name="userAddressForm">
                    <div class="form-group mb10 row">
                        <label class="col-2">收单人：</label>
                        <div class="col-6">
                            <input type="text" required="" maxlength="10" ng-class="{error:userAddressForm.submit &amp;&amp; userAddressForm.name.$invalid}" name="name" id="receiver" placeholder="如何称呼" ng-model="userAddress.customer_name">
                        </div>
                        <!-- ngIf: userAddressForm.submit && userAddressForm.name.$invalid -->
                    </div>
                    <div class="form-group mb10 row">
                        <label class="col-2">手机号码：</label>
                        <div class="col-6">
                            <input type="text" maxlength="11" required="" mobile="" ng-class="{error:userAddressForm.submit &amp;&amp; userAddressForm.contact.$invalid}" name="contact" id="phone" placeholder="138xxxxxxxx" ng-model="userAddress.customer_phone">
                        </div>
                        <!-- ngIf: userAddressForm.submit && userAddressForm.contact.$error.required -->
                        <!-- ngIf: userAddressForm.submit && userAddressForm.contact.$error.mobile -->
                    </div>
                    <div class="form-group mb30 row">
                        <label class="col-2">送餐地址：</label>
                        <div class="col-6">
                            <input type="text" required="" ng-class="{error:userAddressForm.submit &amp;&amp; userAddressForm.address.$invalid}" name="address" id="place" placeholder="详细地址，如武定西路1189号606室" ng-model="userAddress.delivery_address">
                        </div>
                        <!-- ngIf: (userAddressForm.submit && userAddressForm.address.$invalid) -->
                    </div>
                    <div class="form-group mb30 row">
                        <label class="col-2"></label>
                        <div class="col-8">
                            <input type="button" value="保存送餐地址" id="add_address"
                                                   class="btn btn-success normal-btn">
                        </div>
                    </div>
                </form>
            </section>
        </article>
    </section>


            </article>
        </div>
    </section>

        </div>
    </section>

        <footer id="footer">
        <div class="footer-first gray">
            <div class="company-info clearfix fs14 gray">
                <a href="about.html" target="_blank" rel="nofollow">关于我们</a>
                <a href="help.html" target="_blank" rel="nofollow">帮助中心</a>
                <a href="javascript:;" target="_blank" rel="nofollow">法律声明</a>
                <a href="jobs.html" target="_blank" rel="nofollow">人才招聘</a>
                <a href="contact.html" target="_blank" rel="nofollow">联系我们</a>
                <a href="javascript:;" user-feedback="" ng-click="userFeedback=true" class="last" rel="nofollow">意见反馈</a>
                <a href="javascript:;" class="last" target="_blank" style="display:none">上海餐厅导航</a>
            </div>
        </div>
        <div class="footer-last">
            <a target="_blank" class="foot-logo-1 base-logo" href="index.html"></a>
            <div class="tc fs14 light-gray mb10">
              ©2014 waimaichaoren.com All Rights Reserved - 沪ICP备11019908号
            </div>
        </div>
    </footer>


    <div class="disnone common-dialog" height="500" feeedbackclass="userFeedback" type="user-feedback" header="意见反馈" show="userFeedback"><div class="fs16 header"><span ng-bind-html="to_trusted(title)"></span><i ng-show="!hideclose" class="icon close-icon" ng-click="show=false"></i></div><div class="common-dialog-main" ng-transclude=""></div></div>

    <div class="disnone common-dialog" type="alert" index="1001" header="" show="errorShow"><div class="fs16 header"><span ng-bind-html="to_trusted(title)"></span><i ng-show="!hideclose" class="icon close-icon" ng-click="show=false"></i></div><div class="common-dialog-main" ng-transclude=""></div></div>
    <div class="disnone common-dialog" type="alert" index="1002" header="" show="confirm"><div class="fs16 header"><span ng-bind-html="to_trusted(title)"></span><i ng-show="!hideclose" class="icon close-icon" ng-click="show=false"></i></div><div class="common-dialog-main" ng-transclude=""></div></div>
    <div class="disnone common-dialog" header="修改地址" width="420" show="showEditUserAddress"><div class="fs16 header"><span ng-bind-html="to_trusted(title)"></span><i ng-show="!hideclose" class="icon close-icon" ng-click="show=false"></i></div><div class="common-dialog-main" ng-transclude=""></div></div>

     <ul class="site-fixed">
        <li class="scroll-top"><img src="images/scroll_top1.png" alt=""> </li>
        <li class="scorll-feekback" ng-click="userFeedback=true">
            <img src="images/scorll_feekback.png" alt="">
            <div>意见反馈</div>
        </li>
        <li class="scroll-wx">
            <img src="images/scroll_wx.png" alt="">
             <div><img src="images/wx.png" alt=""></div>
        </li>
    </ul>

    <script type="text/javascript" src="/static/js/angular.min.js"></script>
    <script src="/static/js/common.js"></script>


    <script src="/static/js/service.js"></script>

    <script>var feedbackUrl = '/ajax/feedback/';var app = angular.module("app", ["dh.dialog", "dh.form", 'dh.service', 'dh.other']);</script>
    <!--[if lt IE 9]><script src="js/fix.js"></script><![endif]-->



    <script src="/static/js/user_center_address.js"></script>


    <script>angular.bootstrap(document, ["app"]);</script>

    <!-- Baidu Analytics -->

<!-- Baidu Analytics -->
<script src="/static/js/jquery-2.2.3.min.js"></script>
<script>
    // alert(11111, '收货地址 ')
    $('#add_address').click(function () {
        var receiver = $("#receiver").val();
        var phone = $("#phone").val();
        var place = $("#place").val();

        var param = {'receiver': receiver, 'phone': phone, 'place': place};
        $.ajax({
            type: "post",
            dataType: 'json',
            contentType: "application/json",
            cache: false,
            data: JSON.stringify(param),
            success: function (data) {
                if (data.code == "0") {
                    //刷新当前界面
                    console.log('添加成功');
                    window.location.reload()
                } else {
                    alert(data.message)
                    window.location.reload()
                }
            },
            error: function (e) {
                alert('添加失败')
                return false;

            }
        })
    })
</script>
<script>
    $('.btn2').each(function () {
        $(this).click(function () {
            console.log($(this).parent().siblings().eq(0).attr('id'))
            var a_id = $(this).parent().siblings().eq(0).attr('id')
            $.ajax({
                url:window.location.href,
                data:{'id':a_id},
                type:'delete',
                success:function (data) {
                    window.location.reload()
                }
            })
        })
    })
</script>


</body></html>
